import { ref } from 'vue'
import { defineStore } from "pinia"

export const useFactoryStore = defineStore('factoryFactory', () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param
  }

  function getData() {
    return data.value
  }

  return { isShow, show, hidden, data, setData, getData }
})

export const useBrandStore = defineStore('factoryBrand', () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param
  }

  function getData() {
    return data.value
  }

  return { isShow, data, show, hidden, setData, getData }
})

export const useModelStore = defineStore('factoryModel', () => {
  const isShow = ref(false)
  const data = ref([])

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  function setData(param) {
    data.value = param ? param : []
  }

  function getData() {
    return data.value
  }

  return { isShow, data, show, hidden, setData, getData }
})

export const useEmployeeStore = defineStore('factoryEmployee', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useWarehousingStore = defineStore('factoryWarehousing', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useCompletedStore = defineStore('factoryCompleted', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useProportionStore = defineStore('factoryProportion', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})

export const useProgressStore = defineStore('factoryProgress', () => {
  const isShow = ref(false)

  function show() {
    isShow.value = true
  }

  function hidden() {
    isShow.value = false
  }

  return { isShow, show, hidden }
})